home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1986 February
/
Ahoy_Magazine_86-02_1986_Double_L.d64
/
alignment check
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
3KB
|
107 lines
10 s=53280:pokes,6:pokes+1,6
15 tl$="[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
20 bl$="[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
25 t=18:tk=t:open15,8,15,"i"
30 print"[147][158] [213]"tl$"[201]"
35 print" [192][192][192][192][192][192][192][194] 1541 alignment check[158] [194][192][192][192][192][192][192][192]"
40 print" [202]"tl$"[203]"
45 print" by greg granville"
50 print" [213][192][192]actual head position[192][192][192][201]"
55 print" [194] track ="spc(12)"[158][194]"
60 print" [202]"bl$"[203]"
65 print" [213][192]position read from disk[192][201]"
70 print" [194] track ="spc(12)"[158][194]"
75 print" [202]"bl$"[203]"
80 print" [213][192][192]error status[192][192][192][192][192][192][192][192][192][192][192][201]"
85 print" [194]"spc(25)"[158][194]"
90 print" [202]"bl$"[203]"
95 print" [213][192][192]alignment status[192][192][192][192][192][192][192][201]"
100 print" [194]"spc(25)"[158][194]"
105 print" [202]"bl$"[203]"
110 print"push joystick left & right to move head"
115 print" hold fire button to read drive status"
120 :
125 rem **************************
130 rem *** calculate t/s read ***
135 rem **************************
140 :
145 print#15,"m-r"chr$(0)chr$(28)
150 get#15,f$:iff$=""thenf$=chr$(0)
155 a=asc(f$)
160 bt=3anda
165 a=(159anda)or(96+32*((t>17)+(t>24)+(t>30)))
170 print#15,"m-w"chr$(0)chr$(28)chr$(1)chr$(aor4)
175 :
180 rem ******************************
185 rem *** print status to screen ***
190 rem ******************************
195 :
200 print""tab(21)t"[157] "
205 ife<2thenprint""tab(12)"no error detected"
210 ife>1thenprint""tab(12)"read error sensed"
215 r$=str$(tk):ife<1thenr$=" "
220 tr$=right$(r$,2):print""tab(22);tr$
225 ife<>0and val(tr$)<(t-.5)orval(tr$)>(t+.5)then245
230 ife>1andt<>int(t)thenprint""tab(14)"alignment ok ":e=0:goto275
235 ife>1andt=int(t)thenprint""tab(14)"alignment bad":e=0:goto275
240 goto250
245 print""tab(14)"alignment bad":e=0:goto275
250 print""tab(14)" not certain "
255 rem ***************************
260 rem ****** read joystick ******
265 rem ***************************
270 :
275 j=notpeek(56320)and15
280 ifpeek(653)then410
285 if(notpeek(56320)and16)then410
290 ifj=4andt>1thenc=-1:goto340
295 ifj=8andt<35thenc=1:goto340
300 ifpeek(197)=33thenprint#15,"i":t=18:e=0:a=214:goto160
305 ifpeek(197)=23then520
310 goto145
315 :
320 rem ****************************
325 rem *** change head position ***
330 rem ****************************
335 :
340 bt=(bt+c)and3
345 t=t+c*.5:ift<1thent=1
350 tk=int(t)
355 ift>35thent=35
360 b=a and252
365 c=b+bt
370 print#15,"m-w"chr$(0)chr$(28)chr$(1)chr$(c)
375 e=0
380 goto145
385 :
390 rem ***********************
395 rem *** read the header ***
400 rem ***********************
405 :
410 m$="":restore
415 fory=1to11:readx:m$=m$+chr$(x):next
420 print#15,"m-w"chr$(0)chr$(3)chr$(11)m$
425 print#15,"m-w"chr$(0)chr$(0)chr$(1)chr$(208)
430 print#15,"m-r"chr$(0)chr$(0)
435 get#15,er$:e=asc(er$+chr$(0))
440 ife>127then340
445 ife<>1then145
450 :
455 rem ****************************
460 rem *** no error/get track # ***
465 rem ****************************
470 :
475 print#15,"m-r"chr$(22)chr$(0)chr$(4)
480 forz=1to2:get#15,b$:next
485 get#15,b$:tk=asc(b$+chr$(0))
490 goto145
495 :
500 rem ****************************
505 rem *** exit/drive motor off ***
510 rem ****************************
515 :
520 print#15,"m-w"chr$(0)chr$(28)chr$(1)chr$(0)
525 forx=1to10:getx$:next
530 close15:print"[147]motor off"chr$(13)"program terminated":end
535 data169,48,133,69,169,0,133,63,76,177,243